package com.xhl.cloudnacosconsumer.controller;

import com.xhl.cloudserviceapi.EchoService;
import org.apache.dubbo.config.annotation.Reference;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author xuhongliang
 * @date 2020/3/12
 */
@RestController
public class TestController {
    @Value("${spring.application.name}")
    private String appName;

    @Reference
    private EchoService echoService;

    @GetMapping("/echo")
    public String echo() {
        return echoService.echo(appName);
    }

    @GetMapping("/echo2")
    public String echo2() {
        return appName;
    }
}
